package com.geotmt.billingcenter.modules.params.mapper;

import com.geotmt.billingcenter.common.vo.params.*;
import com.geotmt.billingcenter.modules.params.mapper.provider.ParamProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * @Description 查询条件 list
 * @Author      yanghanwei
 * @Mail        yanghanwei@geotmt.com
 * @Date        2019/3/20 20:28
 * @Version     v1
 **/
@Mapper
public interface ParamMapper {

    /**
     * 产品List
     * @return
     */
    @SelectProvider(type = ParamProvider.class, method = "productList")
    List<Product> productList();

    /**
     * 客户List
     * @param productCode
     * @return
     */
    @SelectProvider(type = ParamProvider.class, method = "companyList")
    List<Company> companyList(String productCode);

    /**
     * 用户List
     * @param productCode
     * @param companyId
     * @return
     */
    @SelectProvider(type = ParamProvider.class, method = "userList")
    List<Cuser> userList(@Param(value = "productCode") String productCode,
                         @Param(value = "companyId") Integer companyId);

    /**
     * 内部接口List
     * @param productCode
     * @param companyId
     * @param userId
     * @return
     */
    @SelectProvider(type = ParamProvider.class, method = "innerIntegerList")
    List<InnerInterface> innerIntegerList(@Param(value = "productCode") String productCode,
                                          @Param(value = "companyId") Integer companyId,
                                          @Param(value = "userId") Integer userId);

    /**
     * 数据源List
     * @return
     */
    @SelectProvider(type = ParamProvider.class, method = "dsList")
    List<DataSource> dsList();

    /**
     * 外部接口List
     * @param dsId
     * @return
     */
    @SelectProvider(type = ParamProvider.class, method = "outInterfaceList")
    List<OutInterface> outInterfaceList(Integer dsId);

    /**
     * getById
     * @param id
     * @return
     */
    @Select("select id,account,real_name realName from sys_user where id=#{id}")
    Cuser userGetById(int id);
}
